﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ValidateCode.Service;

namespace ValidateCode.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        public ActionResult Index()
        {
            return View("GetValidateCode");
        }

        public ActionResult GetValidateCode(string codeClass)
        {
            ValidateCodes vCode = new ValidateCodes();
            string code = vCode.CreateValidateCode(4);
            byte[] bytes = vCode.CreateValidateGraphic(code);
            return File(bytes, @"image/jpeg");
        }
    }
}